<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script>
			class Person {
				constructor(name, age) {
					this.name = name;
					this.age = age;
				}
				toString(){
					 return '(' + this.name + ', ' + this.age + ', ' + Person.prototype.hobby + ')';
				}
			}
			
			Person.prototype.hobby="棋类";
			
			let p1=new Person("张三",18);
			let p2=new Person("李四",19);
			console.info(p1.toString());
			console.info(p2.toString());
		</script>
	</body>
</html>